<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>客户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
			 
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
	function submit1(){
		
		var chks=document.getElementsByName('checkboxone');
		  var bl=true;
		for(var i=0;i<chks.length;i++)
		{
		    if(chks[i].checked) 
		    {
		        bl=false;
		        break;
		    }
		} 
		if(bl)
		{
			alert('最少选择一条客户！');
		}else{
			
			$("#inputFrom").attr("action", "${ctx}/crm/selectcustomer/customerselect/checkbox");
			$("#inputFrom").submit();
		};
		
	}	
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="javascript:void(0)">客户选择</a></li>
		<shiro:hasPermission name="workbench:customerselect:edit"><li><a href="${ctx}/crm/selectcustomer/customerselect/form">客户添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="customerselect" action="${ctx}/crm/selectcustomer/customerselect" method="post" class="breadcrumb form-search">
		
		<%-- <ul class="ul-form">
			<li><label>公司名：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul> --%>
	</form:form>
	<sys:message content="${message}"/>
	<form id="inputFrom"  action="" method="post" >
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>公司名</th>
				
				<th>公司地址</th>
				<th>意向状态</th>
				
				<th>添加时间</th>
				<th>是否选择</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page}" var="customerselect">
			<tr>
				<td><a href="${ctx}/crm/findcustomer/findCustomer/form?id=${customerselect.id}">
					${customerselect.name}
				</a></td>
			
				<td>
					${customerselect.address}
				</td>
				<td>
					${customerselect.statusId}
				</td>
			
				<td>
					<fmt:formatDate value="${customerselect.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
			
			<td> <input type="checkbox" style="width: 50px;" name="checkboxone" value="${customerselect.id}">  </td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<input type="button"  onclick="submit1()"  value="确定选择" style="margin-left: 600px;">
	</form>	
</body>
</html>